$.extend($.fn.validatebox.defaults.rules,{
	username:{
		validator:function(value,param){
			return /^[a-zA-Z]{1}[a-zA-Z0-9_.]{4,19}$/gi.test(value);
		},
		message:"只能是英语数字_和.且首字母必须是英文"
	}
});

$.extend($.fn.validatebox.defaults.rules,{
	password:{
		validator:function(value,param){
			return /^(?=.*[0-9].*)(?=.*[a-z].*)(?=.*[A-Z].*)(?=.*\s.*).{6,30}$/gi.test(value);
		},
		message:"必须包含大小写字母，数字和空格"
	}
});

$.extend($.fn.validatebox.defaults.rules,{
	password2:{
		validator:function(value,param){
			return value == $("password").val(); 
		},
		message:"密码输入不一致"
	}
});

$.extend($.fn.validatebox.defaults.rules,{
	cert:{
		validator:function(value,param){
			return /^\d{18}$|^\d{17}[xX]$/gi.test(value);
		},
		message:"18位身份证号码"
	}
});

$.extend($.fn.validatebox.defaults.rules,{
	realname:{
		validator:function(value,param){
			return /^(?![a-z]+$)[\u4e00-\u9fa5a-z]+$/gi.test(value);
		},
		message:"必须是中文和英文"
	}
});

$(function(){
	$("#trigger").on("click" ,function(){
		alert($("#username").textbox("getValue"));
	});
	
	/*$("#cc").on("change",function(){
		alert(11);
	});*/
	
	$("#cc").combobox({
		onChange:function(){
			alert(2222);
		}
	});
	
	$('#dg').datagrid({
	    url:'UserController/datagrid',
	    columns:[[
	        {field:'name',title:'姓名',width:100},
	        {field:'age',title:'年龄',width:100},
	        {field:'address',title:'地址',width:100,align:'right'}
	    ]]
	});
	
	$('#pagedg').datagrid({
	    url:'UserController/pagedatagrid',
	    pagination:true,
	    columns:[[
	        {field:'name',title:'姓名',width:100},
	        {field:'age',title:'年龄',width:100},
	        {field:'address',title:'地址',width:100,align:'right'}
	    ]]
	});
});